Skip to content

MCP: serve all tools to every session; remove toolset env/header hiding - #522

Draft
alosec wants to merge 1 commit into
mainfrom
fix/mcp-serve-all-tools
Draft

alosec wants to merge 1 commit into
mainfrom
fix/mcp-serve-all-tools

Conversation

@alosec

@alosec alosec commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Every MCP session — shared token or signed-in user, any client — now gets the full registered tool surface (33 tools). This removes the machinery that let an operator env var or a request header narrow what a session sees:

  • T49_MCP_TOOLSETS / T49_MCP_READ_ONLY env vars
  • X-T49-MCP-Toolsets / X-T49-MCP-Read-Only request headers
  • packages/mcp/src/toolsets.ts (resolveToolSelection, header parsing) and its test
  • toolsets / readOnly options on createTerminal49McpServer() and ToolSession

Why

Header- or env-based tool hiding was not a real safety boundary: the headers are sent by the client, so any client could send them itself and get whatever surface it asked for. It also made the tool surface differ per deployment/client, which made docs, store listings, and evals drift from what users actually saw.

Write safety is unchanged and comes from the right layer: the tier A/C confirmation protocol (preview → approve → confirm), tool annotations (destructiveHint, readOnlyHint), and T49_MCP_CONFIRMATION_SECRET for unattended HTTP writes. Destructive tools still require a confirmed preview; nothing about authorization or the confirmation flow changes.

Toolsets remain as documentation labels: whoami still reports enabled_toolsets (now the populated toolsets), and TOOLS_OVERVIEW.md keeps its per-toolset grouping.

Store / directory listings (now consistent with the served surface)

  • chatgpt-app-submission.json: adds stop_shipment_tracking, resume_shipment_tracking, cancel_tracking_request with annotations + justifications (the parity test enforces this).
  • claude-connector-submission.json: listing.tool_names +3.

The ChatGPT and Claude directory listings are already live, so after this merges the portal listings need a refresh to add the three tracking_lifecycle tools and match what the server serves.

Tests

  • tsc --noEmit clean.
  • Full local suite matches the main baseline exactly (zero new failures; remaining local failures are pre-existing on main — stale build artifacts and a gitignored worktree copy inside the repo).
  • Snapshots (instructions.txt, tools-list.json) updated intentionally: instructions and tools/list now advertise all 33 tools.

Part of the MCP toolset-hiding cleanup; write safety stays in the confirmation protocol, not in hidden tools.

Every MCP session now registers the full TOOL_REGISTRY (33 tools).
Removed the toolset-selection machinery that let operators or clients
narrow the served surface:

- T49_MCP_TOOLSETS / T49_MCP_READ_ONLY env vars
- X-T49-MCP-Toolsets / X-T49-MCP-Read-Only request headers
- packages/mcp/src/toolsets.ts (resolveToolSelection, TOOLSETS_HEADER)
- toolsets/readOnly options on createTerminal49McpServer and ToolSession

Header- or env-based hiding was not a real safety boundary: any client
could send the headers itself. Write safety comes from the tier A/C
confirmation protocol and tool annotations, which are unchanged.

Toolsets remain documentation labels: whoami.enabled_toolsets reports
populated toolsets, and TOOLS_OVERVIEW keeps the per-toolset grouping.

Store/directory listings now match the served surface:
- chatgpt-app-submission.json: +stop/resume shipment tracking,
  +cancel tracking request (annotations + justifications)
- claude-connector-submission.json: tool_names +3

Docs updated to the all-tools surface (README table merged to 33 rows,
TOOLS_OVERVIEW, mcp.mdx, home.mdx, MCP_README, WORKOS_MCP_SETUP,
.env.local.example). Snapshots updated intentionally.
@mintlify

mintlify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
terminal49 🟢 Ready View Preview Nov 21, 2026, 7:02 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Nov 21, 2026 7:02pm UTC

Request Review

@github-actions github-actions Bot added the risk-shadow:high Shadow-only risk signal: high label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Shadow risk calibration

Signal Result Authority
Path classifier risk:high Deterministic advisory policy
heuristic fallback risk-shadow:high Shadow only

Calibration result: agreement.

Shadow risk never blocks or enables merge. Keep it in observation mode until roughly 50 pull requests have human-reviewed labels, then calibrate before considering any policy use.

@github-actions github-actions Bot added the risk:unknown Advisory evidence unavailable or changed; no merge permission label Nov 21, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
agent trust guards: packages/mcp/src/tools/
registry.ts must declare export function selectTools(selection) once, returning TOOL_RE
GISTRY.filter(...)/
registry.ts must declare export function selectTools(selection) once, returning TOOL_RE
GISTRY.filter(...)
View Logs
agent trust guards: packages/mcp/src/tools/
registry.ts must declare export function selectTools(selection) once, returning TOOL_RE
GISTRY.filter(...)/
registry.ts must declare export function selectTools(selection) once, returning TOOL_RE
GISTRY.filter(...)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions github-actions Bot added risk:high Advisory path risk; current-head human review needed and removed risk:unknown Advisory evidence unavailable or changed; no merge permission labels Nov 21, 2026
@alosec
alosec changed the base branch from main to staging November 21, 2026 19:14
@alosec
alosec changed the base branch from staging to main November 21, 2026 19:26

This branch was successfully deployed

2 active deployments
Preview — 30a809ce Deployed Nov 21, 2026 by vercel[bot]
staging - docs — 30a809ce Deployed Nov 21, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Advisory path risk; current-head human review needed risk-shadow:high Shadow-only risk signal: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant